﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="monitorPostings.aspx.vb" Inherits="MobileStandards.monitorPostings" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    
    <link href="mobilestandards.css" rel="stylesheet" type="text/css" />
    
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <br />
        <table class="style1">
            <tr>
                <td width="50%">
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
            DataSourceID="mydb" ForeColor="#333333" GridLines="None" Width="374px" 
            onRowCommand="GridView1_RowCommand" DataKeyNames="ID,Body">
            
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" ShowDeleteButton="True" 
                    ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" Visible="False" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="Body" HeaderText="Body" SortExpression="Body" 
                    Visible="False" />
                <asp:BoundField DataField="AboutPaper" HeaderText="AboutPaper" 
                    SortExpression="AboutPaper" Visible="False" />
                    
                <asp:BoundField DataField="UserName" HeaderText="User's Name" 
                    SortExpression="UserName" ReadOnly="True" />
                <asp:BoundField DataField="PostingDate" 
                    HeaderText="Date of Posting" SortExpression="PostingDate" 
                    DataFormatString="{0:dd/MM/yyyy}" ReadOnly="True" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
                </td>
                <td width="50%">
    
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <br />
        <br />
        <asp:SqlDataSource ID="mydb" runat="server" 
            ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\mobilestandards.accdb" 
            ProviderName="System.Data.OleDb" 
           
            
            SelectCommand="SELECT [Title], [Body], [AboutPaper], [UserName], [PostingDate], [ID] FROM [Posting]" 
            DeleteCommand="DELETE FROM [Posting] WHERE [ID] = ?" 
            InsertCommand="INSERT INTO [Posting] ([Title], [Body], [AboutPaper], [UserName], [PostingDate], [ID]) VALUES (?, ?, ?, ?, ?, ?)" 
            UpdateCommand="UPDATE [Posting] SET [Title] = @Title WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Body" Type="String" />
                <asp:Parameter Name="AboutPaper" Type="Int32" />
                <asp:Parameter Name="UserName" Type="String" />
                <asp:Parameter Name="PostingDate" Type="DateTime" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="Body" Type="String" />
                <asp:Parameter Name="AboutPaper" Type="Int32" />
                <asp:Parameter Name="UserName" Type="String" />
                <asp:Parameter Name="PostingDate" Type="DateTime" />
                <asp:Parameter Name="ID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
